package command

import (
	"gitee.com/crack007/goose/gscore"
)

type DefaultCmdHandle struct {
	cmdInstance *Cmd
}

func (x *DefaultCmdHandle) OnBeforeInit() {

}

func (x *DefaultCmdHandle) OnInitFlags() {

}

func (x *DefaultCmdHandle) OnInitConfig() {

}

func (x *DefaultCmdHandle) OnInitService() {

}

func (x *DefaultCmdHandle) OnBeforeRun() {

}

func (x *DefaultCmdHandle) OnRun() error {
	//TODO implement me
	panic("implement me")
}

func (x *DefaultCmdHandle) OnShutdown() {

}

func (x *DefaultCmdHandle) OnInjectServer(iServer gscore.IServer) {
	if v, ok := iServer.(*Cmd); ok {
		x.cmdInstance = v
		return
	}

	panic("OnInjectServer error")
}

func (x *DefaultCmdHandle) GetCmd() *Cmd {
	return x.cmdInstance
}
